Release 3.2  Copyright ã1993 by NeXT Computer, Inc.  All Rights Reserved.

3	NetInfo Networking

Once you've set up your basic network, you'll need to start thinking about maintenance. Your network configuration may never need adjusting, but if you want to modify network features, such as turning automatic host addition on or off, or changing the network time service, you'll need to use applications other than SimpleNetworkStarter. In addition, a thorough understanding of NetInfo can be invaluable while you administer your network. 

This chapter covers how to add and delete hosts, set up network time service, and add host aliases and netgroups. It also discusses the applications used to administer a NetInfo network, and describes the data structures, files, and processes that make up NetInfo.

Enabling Automatic Host Addition

If you enabled automatic host addition when you configured your network with SimpleNetworkStarter, you don't need to do it again. However, if you omitted this feature during setup, you can't go back now and enable it with SimpleNetworkStarter. Instead, use HostManager to modify your network setup. 

1.	Log into any networked computer, using any valid account.

2.	Start up HostManager, located in /NextAdmin. If you're not logged in as root, HostManager will display a panel telling you that you must have superuser status to run this application; enter the root password and click Login.

3.	Choose Automatic Host Configuration from the Network menu. The Select NetInfo Domain panel appears.

,

4.	Select the root domain by clicking ª/º in the left column. (If your NetInfo setup is more complicated, select whatever domain is appropriateÐbut not the local domain.) You specify the root domain so that new hosts will be recognized throughout the network. Click OK. The automatic host configuration panel appears.

,

5.	Select the range of assignable addresses.

When a computer is automatically added to the network, the Internet address it is assigned is chosen from the range defined by the values in the From and To fields. The network portion of these values (everything up to the last decimal) should be the same in both fields, and the final number can range from 1 to 253. Be careful that any addresses already assigned to computers aren't included in the range you set here. For example, the server has probably been assigned the first number, ending in 1.

Note:  This section describes a class C network. If you have a class A or B network, the numbering will be different. See Appendix C, ªInternet Addressing,º for details.

6.	Enter an address in the Temporary field to be temporarily assigned to new computers while they're being added. Make sure that this value has the same network number as the NetInfo and configuration server but is not in the range of addresses that are assignable to new computers. A number ending in 254 is a good choice.

7.	Use the Network Password section of this window to determine what type of security check is performed when a new system is added to the network. By default, the root password of the master NetInfo server will have to be entered before a new host can be added to the network. 

If you prefer, you can use a network passwordÐa password that's independent of the root password on any particular computer. This password allows network users to add their own computers to the network without having access to the root password, but it protects against the addition of an unauthorized computer. To enable this feature, click the Network Password button. You're presented with the Network Password panel, where you need to enter and confirm the new password. 

,

If you don't want any password to be required when a new computer is added to the network, click the None button.

8.	If there's no check mark in the Automatic Host Configuration Enabled check box, click it to enable this function. 

,

9.	Click OK to save the addresses and enable automatic host addition.

10.	If you're prompted for the root password of the NetInfo domain, enter the password and click Login. The root password of the domain is initially the same as the root password of the NetInfo server. 

,

Disabling Automatic Host Addition

If you've enabled automatic host addition and now want to disable it, perform the following steps:

1.	Log into any networked computer.

2.	Start up HostManager, located in /NextAdmin. If you're not logged in as root, a panel will appear prompting you to enter the root password; enter the password and click Login.

3.	Choose Automatic Host Configuration from the Network menu.

4.	In the Select NetInfo Domain panel, select the root NetInfo domain, or an intermediate domain if you have a more complicated network. Click OK.

5.	Click the Automatic Host Addition Enabled check box so that the check mark disappears. Click OK.

6.	If you're prompted for the root password of the domain, enter the password and click Login.

Adding New Hosts to the Network 

To add a new host to the network, you need to create a host entry for it. A host entry includes the computer's Ethernet address, its Internet address, and its host name. If you've enabled automatic host addition, the host entry is created for you. If you've chosen not to use automatic host addition, you need to create the host entry yourself.

Automatically Adding a New Host

If you've enabled automatic host addition, use the following procedure to add a new host:

1.	Physically connect the new host to the network. Do this before you start it up; otherwise, it won't be correctly added to the network.

2.	Turn on the new computer.

3.	As the computer starts up, a series of messages is displayed in a window on the new system, asking for configuration information. After you provide the information, the configuration server adds a new host entry to its database.

a.	The first message indicates that the configuration server couldn't find the new computer's Ethernet address in its database. You're then prompted for the host name. 

Network doesn't recognize computer.
Enter host name:

Enter the host name you've chosen for the computer and press Return.

b.	Next, you're asked if you want to add the host to the network. 

Add computer to the network [y/n]?

Type y and press Return.

c.	If you're using a password for automatic host addition, you're prompted for it. 

Enter network password:

Enter the network password, or the root password of the server, depending on which scheme you've chosen, and press Return.

If you see any messages other than those discussed here, see the ªTroubleshootingº section at the end of this chapter.

Manually Adding a New Host

If you've chosen not to enable automatic host addition, use the following procedure to add a new host to the network.

Determining the Ethernet Address

First you need to determine the Ethernet address of the computer you're adding to the network. Use the following procedures to get the Ethernet address from the ROM monitor of the new host. Be sure to do this on the system you're about to add to the network, not on the server:

1.	Turn on the host computer. When you turn on the system, the first thing you see is the message ªTesting System.º This message disappears within seconds, and the boot process begins. 

2.	Immediately after the ªTesting Systemº message goes away, stop the boot process by holding down the Command bar and Alternate key and pressing the ~ key (without pressing Shift). On keyboards with two Command keys, hold down the right Command key while pressing the ~ key. This displays the ROM monitor window, which contains information about the hardware, including the Ethernet address. 

Here's an example of the ROM monitor output (yours will look slightly different): 

CPU MC68040 33 MHz, memory 70 nS
Ethernet address: 0:0:f:0:7:3d
Memory size 16MB

NeXT>

Note:  If you were a little slow with your key sequence, you see the Restart/Power-Off panel instead. Press the Power key and try again.

3.	Write down the Ethernet addressÐit's the sequence of numbers separated by colons (in the example, the Ethernet address is 0:0:f:0:7:3d). Be sure to copy the number exactly as it appears. 

Creating the Host Entry

Now that you have the Ethernet address of the new system, add the new host entry to the NetInfo database (for now, leave the host system as is). Be sure to do this on a computer that's already connected to the networkÐnot on the system you're adding to the network:

1.	Start up the HostManager application, located in /NextAdmin. 

2.	If you're not logged in as root, HostManager displays a panel telling you that you must have superuser status to run this application. Enter the password for the root account and click Login.

3.	Open the New Host window by choosing New from the Host menu. You use this window to create a host entry. 

,

4.	Replace newhost in the Hostname field with the host name you want to give the new computer. Remember, a host name must be unique, should contain no more than 8 lowercase characters, and shouldn't contain anything other than letters, numerals, dashes (-), and underbars (_). (These aren't absolute rules, but following these suggestions makes sure that you'll never have any problem with your host names.) The names localhost, broadcasthost, and mailhost are reserved and shouldn't be used here.

5.	Replace the default Internet address in the IP address field with a unique address for the new host. HostManager doesn't check whether you've chosen a unique address, so be carefulÐduplicate Internet address assignments will cause network problems. The best strategy is to increment the number sequentially, starting with the address of the NetInfo and configuration server. Valid numbers are in the range 1 to 253. Again, if you have a class A or B network, your numbering will be different.

6.	Replace the value in the Ethernet Address field with the one you wrote down earlier. Be careful to enter it exactly as it was displayed by the ROM monitor.

7.	You can enter the name of the system owner in the System Owner field. This isn't used by the network, but makes it easier for you to identify the computer.

8.	If you want to indicate the type of computer, use the System Type button to drag to the appropriate choice. Again, this field is for identification purposes only.

9.	If you want this host to be known by more than one name, you can add an alias. Click in the text field in the Host Name Aliases section, enter the alias name, then click Add. The same restrictions that apply to host names in general also apply to alias names.

10.	If you want this host to be a member of a netgroup, add it in the Netgroups area. A netgroup is similar to a user group in that it's a name used to reference a group of hosts. 

You can use a netgroup name in place of a host name in some situations, such as when you're exporting remote directories. To add this host, click the text field under Netgroups, enter the group name, then click Add. 

,

11.	Ignore the Netboot Configuration button because it's used to set up a NetBoot client. See Chapter 13, ªNetBooting,º for details.

12.	Save the new host entry by choosing Save from the Host menu. The Save To NetInfo panel appears.

,

13.	Specify the root domain by clicking ª/,º or select an intermediate domain appropriate for your site. The box labeled ªThis is host's parent domainº enables the automatic binding of this computer's local domain to its parent domain (for more information, see Chapter 10, ªConfiguring a Large Networkº). Unless you are on a mixed network, leave the box checked. For more information, see Chapter 11, ªNeXT Computers in a Mixed Network.º Click OK.

14.	Enter the root password for the domain and click Login, if prompted.

15.	On the new host, start the boot process by typing b followed by pressing Return.

Repeat this procedure for each additional host. Be sure to close the New Host window and then choose the New command for each new host, rather than just changing the information for the previous host.

Adding a Modified Host

The Ethernet address, stored on the EPROM chip, uniquely identifies each NeXT computer. If you replace the CPU board or EPROM of a NeXT computer, that computer will have a different Ethernet address, and the configuration server will no longer recognize it. In order for this computer to be recognized, you need to modify its host entry.

Automatically Adding a Modified Host

If you've enabled automatic host addition, use this procedure to add the modified host to the network:

1.	Physically connect the modified host to the network. Do this before you start up the computer; otherwise, it won't be added correctly.

2.	Turn on the computer.

3.	As the computer starts up, a series of messages is displayed in a window on the modified system, asking for configuration information. After you provide the information, the configuration server modifies the host entry in its database.

a.	The first message indicates that the configuration server couldn't find the modified computer's new Ethernet address in its database. You're then prompted for the host name. 

Network doesn't recognize computer.
Enter host name:

Enter the existing host name for the computer:

b.	Because the configuration server has a host entry in its database for the host name you entered, but the Ethernet address doesn't match, it asks if the computer has a new CPU board or EPROM. 

Name recognized. New CPU board or ROM chip [y/n]?

Type y and press Return.

c.	Next, you're asked if you want to add the modified host to the network. 

Add computer to the network [y/n]?

Type y and press Return.

d.	If you're using a network password for automatic host addition, you're prompted for it. 

Enter network password:

Enter the network password or the root password of the server, depending on the scheme you've chosen, and press Return.

If you see any messages other than those described here, see the ªTroubleshootingº section later in this chapter.

Manually Adding a Modified Host

If you've chosen not to enable automatic host addition, and need to reconnect a modified host to the network, follow these procedures.

1.	Determine the Ethernet address of the modified host following the procedures in ªManually Adding a New Hostº earlier in this chapter. 

2.	Log into a computer that's already connected to the network and start up HostManager, located in /NextAdmin.

3.	If you're not logged in as root, HostManager displays a panel telling you that you must have superuser status to run this application. Enter the password for the root account and click Login.

4.	Choose Open from the Host menu. The Open in NetInfo Domain panel appears.

,

5.	Click ª/º in the Domain section of this panel, or choose the appropriate intermediate domain.

,

6.	In the Hostname list in the Open In NetInfo Domain panel, click the host you want to modify (in this example, mars). Click OK. The host window appears. You use this window to edit a host entry. 

,

7.	Replace the value in the Ethernet Address field with the one you wrote down earlier. Be careful to enter it exactly as it was displayed by the ROM monitor. Leave the other values as they are.

8.	Save the modified host entry by choosing Save from the Host menu.

9.	Enter the root password of the domain and click Login, if prompted.

10.	On the modified host, start the boot process by typing b followed by pressing Return.

Deleting a Host from the Network

To remove a host entry from the network database, follow these procedures:

1.	Log into any networked computer, using any valid account.

2.	Start up the HostManager application, located in /NextAdmin.

3.	If you're not logged in as root, HostManager displays a panel telling you that you must have superuser status to run this application. Enter the password for the root account and click Login.

4.	Choose Open from the Host menu.

5.	Click ª/º in the Domain panel, or the name of the appropriate intermediate domain.

,

6.	In the Hostname list in the Open In NetInfo Domain panel, click the host you want to delete (in this example, mars is deleted). Click OK. The host window appears. 

	Warning:	Don't delete localhost or broadcasthost from the local domain, or the host name of any master NetInfo server. 

,

7.	Choose Host from the main menu, then choose Delete. An attention panel like the following appears, asking you to confirm that you really want to delete the host. Click Yes.

,

8.	Enter the root password for the domain and click Login, if prompted.

The host you selected is now removed from the network database. 

Adding Host Aliases and Netgroups

If you want to add an existing host to a netgroup, or you want to create host name aliases for an existing host, use HostManager:

1.	Log into any networked computer, using any valid account.

2.	Start up HostManager, located in /NextAdmin.

3.	If you're not logged in as root, HostManager displays a panel telling you that you must have superuser status to run this application. Enter the password for the root account and click Login.

4.	Choose Open from the Host menu. The Open in NetInfo Domain panel appears.

,

5.	Click ª/º in the Domain panel, or the name of the appropriate intermediate domain.

6.	In the Hostname list in the Open in NetInfo Domain panel, click the host you want to modify (in this example, mars). Click OK. The host window appears. 

,

7.	To let this host be known by more than one name, add an alias. Click in the text field in the Host Name Aliases section, enter the alias name, then click Add. This computer can now be referenced using its host name or any of its aliases. The same restrictions that apply to host names in general also apply to alias names.

8.	To make this host a member of a netgroup, add it in the Netgroups area. A netgroup is similar to a user group in that it's a name used to reference a group of hosts. 

You can use a netgroup name in place of a host name in some situations, such as exporting a remote directory. To add this host, click in the text field under Netgroups, enter the group name, then click Add. 

9.	Save the modified host entry by choosing Save from the Host menu. 

10.	Enter the root password of the domain and click Login, if prompted.

Configuring Network Time Service

Each computer maintains an internal clock that keeps track of time. When several computers are connected on a network, it's important to make sure that all of the computers agree on the time, especially if they're sharing files. To do this, you must designate one or more hosts as time servers and set the remaining hosts to be time clients. If you set this feature with SimpleNetworkStarter, you don't need to do it again. However, if you want to enable network time service after the network has been configured, or you want to have multiple time servers, you need to use HostManager. 

Choosing Time Servers

Three kinds of hosts are involved in network time serviceÐmaster time servers, clone time servers, and time clients. Clients set their time to time servers, and have a preference for clone time servers. If a client can't find a clone server on the network, it looks for a master time server. If it finds no master server, it relies on its own clock.

1.	Choose one or more computers to be clone time servers. 

Clone servers try to set their time to master time servers. If a clone server finds no master server, it looks for other clone servers on the network. If there are other clone servers on the network, all of them negotiate an average of what their internal clocks indicate. If there are no other time servers on a network, either master or clone, a clone server relies on its own clock. Unless you have a very large network, it's probably best to designate only clone servers (no masters). A good strategy to use is to designate all NetInfo servers as clone time servers.

2.	Choose one or more computers to be master time servers, if needed. 

A master server looks for other master servers. If it finds any, together they reach consensus about the correct time. If a master time server finds no peers, it uses its own clock. If you have a very large network, having one or two master time servers makes it easier to reset the network time, while adding a few clone servers will help reduce the load on the master time server.

Enabling Time Service

Before you can designate time servers, you need to enable automatic time service. If you used automatic host addition to add hosts to your network, or you enabled time service when you manually added your hosts, there's no need to do it again. Otherwise, follow these procedures for each computer on the network: 

1.	Log into the computer.

2.	Start up HostManager, located in /NextAdmin.

3.	If you're not logged in as root, a panel appears asking you to log in as the superuser. Enter the root password, then click Login.

4.	Choose Local from the main menu. The Local Configuration window appears 

,

5.	In the Time Standard area, click the button labeled Use Network Time.

6.	Click Set.

7.	Reboot your computer for the change to take effect.

Time service is now enabled for this computer.

Designating Time Servers

To designate hosts as time servers, follow these steps:

1.	Log into any networked computer using any valid account.

2.	Start up the HostManager application, located in /NextAdmin.

3.	If you're not logged in as root, HostManager will display a panel telling you that you must have superuser status to run this application. Enter the password for the root account and click Login.

4.	Choose Network Time Configuration from the Network menu. The Select NetInfo Domain panel appears. 

,

5.	Select the root domain by clicking ª/º. Click OK. A panel like this appears.

,

6.	Click the Time Service Enabled check box. 

7.	For each host you decide to designate as a clone time server:

a.	Click the name of the host you've selected to be a clone time server (venus, in this example).

b.	Click the Clone button. A ªCº appears next to the host's name.

8.	For each host you want to designate as a master time server:

a.	Click the name of the host you've selected to be a master time server (earth, in this example).

b.	Click the Master button. An ªMº appears next to the host's name.

Note:  Since the remaining hosts are already classified as clients, you don't have to specify what they areÐthe Client button is used only if you want to change a time server back to a time client.

,

9.	Click Set.

10.	For the changes to take effect, all the newly designated time servers need to be rebooted. You also need to reboot any new time clients.

The hosts to be used for serving network time are now identified. 

Disabling Time Service

If you want a computer to use its own clock and never look for time servers, follow these procedures: 

1.	Log into the computer.

2.	Start up HostManager, located in /NextAdmin.

3.	If you're not logged in as root, a panel appears asking you to log in as the superuser. Enter the root password, then click Login.

4.	Choose Local from the main menu. The Local Configuration window appears. 

,

5.	In the Time Standard area, click the button labeled Ignore Network Time.

6.	Click Set.

7.	Reboot your computer for the change to take effect.

Time service is now disabled for this computer.

Using the Network

With your network configured, many features are now available. In addition to all of the functions described elsewhere in this manual, you might find certain UNIX commands helpful as you work with and troubleshoot your network.

Using UNIX Networking Commands

Sometimes you might want to make a direct connection to a remote host. Perhaps you need to log into a faraway host, or you need to move a file from one computer to another. The UNIX commands telnet, rlogin, rsh, rcp, and ftp are used to perform these tasks; you execute these commands from a shell window.

Three of these commandsÐtelnet, rlogin, and rshÐare used to simulate a terminal connected to a remote host. For file transfer, use ftp or rcp; these utilities provide a way to send or receive individual files or entire directory trees. For further details on each of these programs, see the UNIX manual pages.

Remote Application Execution

It's possible to put the entire interface for any NeXTSTEPäapplication on a different computer than the one that's running the application. This can be useful for troubleshooting. It might also be useful for having a computer execute a computation-intensive process if you're already loading down your own computer with other processes. 

Executing an Application on a Remote Computer

In the following steps, your computer is called yourhost and the remote computer otherhost. In this example, otherhost runs the Digital Websteräapplication while the window is displayed on yourhost. 

1.	On yourhost, start up Preferences. Scroll to the UNIX button, click it, then click the Public Window Server check box. A check mark appears. Hide Preferences.

Note:  Having a computer set up as a public window server is a security risk. See Chapter 14, ªSecurity,º for more information.

2.	Open a shell window and log into otherhost using telnet or rlogin, whichever you prefer.

3.	On otherhost, enter the following command, replacing yourhost with the host name of your computer:

/NextApps/Webster.app/Webster -NXHost yourhost

The application interface soon appears on your computer.

All interaction is with the application interface on yourhost while the application actually runs on and uses the resources of otherhost.

4.	When you're finished, quit the application.

Executing an Application on the Local Computer 

With a similar technique, you can run an application on your computer and have its interface shown on another. In this example, you run Webster on yourhost with the application interface on otherhost.

1.	On otherhost, start up Preferences. Scroll to the UNIX button, click it, then click the Public Window Server check box. A check mark appears. Hide Preferences.

Note:  Having a computer set up as a public window server is a security risk. See Chapter 14, ªSecurity,º for more information.

2.	Open a shell window on yourhost. Enter the following command, replacing otherhost with the host name of the remote computer:

/NextApps/Webster.app/Webster -NXHost otherhost

3.	Go to otherhost, where you see the Webster menu and window appear. Use the application.

All interaction is with the Webster interface on otherhost while the application actually runs on and uses the resources of yourhost.

4.	When you're finished, quit Webster. The prompt returns in the shell window on yourhost.

Examining the NetInfo Database

SimpleNetworkStarter and HostManager are applications with friendly interfaces to a sometimes complicated collection of data and operations. In this section, you'll look at some of the underlying details of the network you built with SimpleNetworkStarter. The understanding you gain about NetInfo networks can help you isolate problems and correct them as they arise; it can also help you customize your network. 

NetInfo Tools

With each NeXT computer, several tools are provided that allow you to manipulate the NetInfo database. A suite of applications (collectively called the Manager applications) provides a friendly interface to the most common activities you'll be performing while administering one or more NeXT computers. In addition, several UNIX utilities are available for low-level, direct access to the NetInfo system. 

The Manager Applications 

Each NeXT computer comes with nine applications, mostly located in /NextAdmin, used to manage system administration information. What follows is a brief description of each application, to help you determine which one to use.

·	SimpleNetworkStarter sets up a simple NetInfo network. Its use is covered in Chapter 2.

·	NFSManager is used to import and export directories, allowing remote access across the network. Chapter 4, ªSetting Up the Network File System,º explains how to use NFSManager.

·	UserManager is used to add, modify, and delete user accounts, as well as create and remove user groups. This application was introduced in Chapter 2, and is covered more thoroughly in Chapter 5, ªManaging User Accounts and User Groups.º

·	PrintManager, located in /NextApps, is used to add a new printer or fax modem to a system, configure a network printer or fax modem, and monitor the progress of print requests. PrintManager is described in the User's Guide.

·	HostManager, described earlier in this chapter, is used to set up and maintain information about host computers.

·	NetInfoManager allows you to access and manipulate NetInfo data. The section ªUsing NetInfoManagerº later in this chapter describes how to use this application.

·	NetWareManager is used to authenticate users on a Novell NetWare network and to set up access to printers on a NetWare network. Its use is covered in Chapter 11, ªNeXT Computers in a Mixed Network.º

·	PhoneManager and PhoneConnector are used to configure and use ISDN networking. They're also covered in Chapter 11.

NetInfo UNIX Utilities

In addition to the Manager applications, several utilities are provided to allow direct manipulation of the NetInfo data. These commands are executed in a shell window.

niload	Lets you load UNIX flat files (such as /etc/printcap and /etc/passwd) into a NetInfo database. This is useful when you're converting existing administrative information to be used by NetInfo. 

nidump	Takes data from a NetInfo database and creates output in UNIX file format. This is especially useful when sharing administrative information in a mixed network (Chapter 11 discusses this in more detail). 

niutil	Lets you read from and write to a NetInfo database. 

nidomain	Lets you create and destroy NetInfo databases and tells you which NetInfo databases are served by a given computer.

More information on these commands can be found in the UNIX manual pages.

Using NetInfoManager

The NetInfoManager application allows you to examine and manipulate NetInfo information. While the other Manager applications have specialized uses, NetInfoManager is a general access tool. Throughout the rest of this manual, you'll use it to examine the results of many of the tasks you perform. This section describes how to use NetInfoManager and defines the various components of the NetInfo system.

Precautions

Great care should be taken when using NetInfoManager. Because it's a direct access tool, you can very easily make a potentially serious mistake, such as introducing inconsistent data into the NetInfo database. Be sure to double-check your work before saving changes. 

By default, a confirmation panel like the following appears whenever you modify the database. 

,

You can turn off this feature for a specific domain by choosing Never Confirm Modifications from the Security menu of the Domain menu. To disable the confirmation panel for all domains, choose Preferences from the Info menu, then click Never Confirm Modifications in the Preferences panel and click OK. 

Note:  If you haven't disabled this feature, the confirmation panel will appear whenever you attempt to make any change to a domain. This step is not always included in the procedures in this manual.

Unless you feel confident about what you're doing, only use NetInfoManager for changes that you cannot make with any of the other Manager applications. Be sure that you have current backups, just in case you make a mistake.

NetInfo Directories

The information in a NetInfo database is organized into NetInfo directories. This organizational structure is very similar to that of the UNIX file system, but you should be careful not to confuse them. In the file system, a directory has files containing information and other subdirectories. In NetInfo, the information associated with a directory is not in files, but in the directory itself. This distinction is clarified in the section ªProperties and Valuesº later in this chapter. Just as with the file system, the NetInfo directory structure begins at the top level with a root directory, represented by a slash (ª/º). 

Use NetInfoManager to examine the NetInfo directories:

1.	Start up NetInfoManager, located in /NextAdmin. A window displaying the information contained in your local NetInfo database appears (the window displayed on your system may not match exactly): 

,

2.	Click the directory /users.

,

The directory /users has subdirectories of its own, each containing the information about a single user account. Notice that the directory browser used here works much the same as the browser in the File Viewer you've used in the Workspace Managerä.

Properties and Values

Although NetInfo directories and file system directories are similar in having a hierarchical structure, there are important differences. A NetInfo directory contains more information, and contains that information in a two-tiered structure instead of a flat file. In the traditional file system, files hold data but directories don't. A NetInfo directory may have subdirectories, but it also holds data in the form of properties. 

Take a look at how directories store data in properties by performing the following:

1.	To examine the properties associated with the directory /users, double-click /users in the domain window. The Directory window appears.

,

As shown in this window, each property is made up of two parts: the property key (which can be thought of as the name of the property), listed in the Properties column, and the property values, shown in the Values column. In this example, the /users directory has a single property with the key name that has the value users. A NetInfo directory can have zero or more properties, and a property can have zero or more values. 

2.	Choose Directory from the NetInfoManager main menu. The Directory menu appears.

,

The commands in this menu are used in conjunction with the text field in the bottom of the Directory window to manipulate the directory properties. Notice that the property key, name, is displayed in the text field. Entering text in this field, followed by a Return, will modify the property key. 

Commands from the Directory menu allow you to insert or append a new property key, while the Delete command from the Edit menu allows you to delete a property. Modifying a property key is necessary when adding new properties, but not advisable otherwise.

	Warning:	It's not a good idea to change an existing property key, since system software looks for information stored in properties with specific keys. Changing a property key can result in a wide variety of system errors.

3.	Click users in the Values column. This selects the property value, allowing you to manipulate it. Notice that users now appears in the text field at the bottom of the window.

,

With the value selected, the commands in the Directory and Edit menus now allow you to insert, append, delete, and modify property values rather than keys. Notice that the commands in the Directory menu have changed to reflect this.

,

4.	Close the Directory window by clicking the close button.

5.	In the domain window, click the directory /groups. 

,

This directory has several subdirectories, each representing a different user group.

6.	Click the subdirectory wheel. It will shift to the middle column where it will appear highlighted. Open the Directory window for the group wheel by double-clicking it.

,

Notice that this directory has several properties in addition to the name property (passwd, gid, and users). 

7.	Click the users property key. This property has two values associated with it, root and me (the names of the users belonging to the group wheel).

,

8.	Close the directory window.

Viewing Directories 

By default, the directory browser in NetInfoManager displays the value of the name property for each directory. You might want to see the value of some other property for all the directories. For example, you might want to discover which user account is assigned a specific user ID. Follow these steps to change how the directories are displayed:

1.	Still in NetInfoManager, click me under the users directory. 

,

2.	Choose View from the Domain menu, then View Directories By. A panel appears containing a list of properties.

,

3.	Select uid in the list, then click Set View. The directory browser changes to show the value of the uid property for each directory. 

,

4.	To determine the user name associated with a specific user ID, you can open the appropriate Directory window. For example, double-click 4 in the directory browser. 

,

As you can see from the value of the name property, the user uucp is assigned the user ID 4.

5.	Close the directory window.

6.	Choose View Directories By again. Click name in the resulting list, then click Set View. The directory browser once again displays the value of the name property for each directory.

NetInfo Domains

So far, you've been examining the administrative information specific to an individual computer. As you've seen, this information is stored in directories. The information in a hierarchy of these directories, from ª/º all the way to the deepest subdirectory, is called a NetInfo domain. 

A domain can hold the administrative data for a single computer, a department, or even an entire company. This administrative data includes information about the domain's users and about the resources to which these users have access (such as computers, shared directories, and printers). The information that's available only to an individual computer is called the computer's local domain.

The following figure shows three standalone computers, each serving its own local domain (represented by a gray rectangle). 

,

Just as the information within a domain is organized into a hierarchy of directories, NetInfo domains are also organized into a hierarchy. At the top of this hierarchy is the root domain, represented by a slash (ª/º). The lowest level of the domain hierarchy is the local domain. In a two-level domain, the parent of all local domains is the root domain. In more complicated networks, there may be more levels of the hierarchyÐmidlevel domains between local domains and the root domain (see Chapter 10, ªConfiguring a Large Networkº). On a NeXT computer that isn't connected to a network, the local domain is the only domain available, so it also serves as the root domain. All domains can contain the same kinds of information.

The next figure shows the same three computers as in the previous figure after having been connected and configured with SimpleNetworkStarter.

,

The hosts mars and earth still only serve their respective local NetInfo domains. Because the domains are now linked into a two-level domain hierarchy, each local domain is known by the same name as the host serving it. The local domain on venus is named /venus. The host earth serves its own local domain (/earth) and also serves the root domain (ª/º).

When a host needs to find a piece of information stored in NetInfo, it first looks in its local domain. If it finds what it's looking for, it uses that. If it doesn't, it looks in the parent domain, if there is one. If the information can't be found in the immediate parent domain, the search process is continued until the root domain is reached.

Returning to the previous example, when a search for NetInfo information is made on the host mars, the local domain /mars is checked first. If the information isn't found there, the search continues in the root domain (ª/º). A search for NetInfo information never travels down a different branch of the domain hierarchy. For example, a search for information on mars would never access the domain /venus or /earth.

Multiple Domains

When you start up the NetInfoManager application, it defaults to the local domain. (You can, however, set a different domain as the default with the Preferences command from the Info menu.) To examine or modify information stored in a different domain, do the following:

1.	Choose Open from the Domain menu. The Select NetInfo Domain panel appears: 

,

By configuring your network, you have created a two-level domain hierarchy with the root domain at the top and each of the local domains (one for each computer on the network) at the lower level. From this panel, you select the domain you want to open by clicking the name in the browser or typing the name in the text field. Note that you can access any domain in the hierarchy from any host on the network.

2.	Select the root domain by clicking ª/º in the left column. Note that ª/º now appears in the Domain field near the bottom of the panel.

,

3.	Click OK. A new domain window for the root domain of the network appears. It's represented by ª/º in the title bar.

,

Notice that the title bar of a domain window includes the tag of the NetInfo database (network), the host name of the server (earth), and the name of the domain (ª/º). (Tags are covered a little later in this chapter.)

4.	Drag the root domain window away from the local domain window in back of it so that you can compare them; the domains are clearly different. 

5.	Click the directory machines in the second column of each window. In the local domain window, you'll just see broadcasthost and localhost.

,

In the root domain window, in the right column, you see a list of all the host computers you added to the network.

,

6.	Pick a host name and click it. The machines directory is now in the middle column with the computer you chose highlighted. 

7.	Double-click the selected host name. A Directory window appears (mars is the host used in this example).

,

These properties store the host entry information for this computer. They were created when you added this host to your network.

8.	Close the Directory window.

9.	Click /locations in the root domain window. 

,

The locations directory stores information about the locations of various files and servers. The homes directory identifies home directory servers and the localapps directory identifies an application server. These directories are described in Chapter 4, ªSetting Up the Network File System.º The sendmail directory identifies the sendmail configuration file, and is described in Chapter 6, ªManaging Electronic Mail.º

10.	Click ntp, then double-click it to open a Directory window. Click host. 

,

The host property of the ntp directory identifies network time servers.

11.	Close the Directory window and quit NetInfoManager. 

Underlying Data Files and Processes

You've just used NetInfoManager to examine the NetInfo databases associated with your network. Now, you'll look at the files that contain the databases, as well as the processes used to access them. In order to be able to see some of the directories from the File Viewer, you must use Preferences to set the UNIX Expert option in the Expert Preferences panel.

The /etc/netinfo Directory

1.	Log into a NetInfo server, then use the File Viewer to find /etc/netinfo. Note the two subdirectories, local.nidb and network.nidb. 

,

On any NeXT computer, the directory /etc/netinfo always has a local.nidb subdirectory. This subdirectory contains the data files for the local domain. When you created your network with SimpleNetworkStarter, you built the network.nidb directory, which holds the files for the root domain. For each domain in a hierarchy, there's a separate directory labeled tag.nidb, where tag is replaced by a string identifying the domain.

Note:  Because of the importance of the information stored in /etc/netinfo, make sure you maintain reliable backups of this directory.

2.	Examine the contents of these directories. In each, you'll find a file named Collection; there may also be one or more additional files named extension_somenumber. 

,

These are the data files containing the information for each domain. Information for the local domain for each of the other hosts will be stored on each host in the directory /etc/netinfo/local.nidb.

The /etc/hostconfig File

During system startup, the file /etc/hostconfig is consulted for network configuration information. This file was modified by SimpleNetworkStarter when you set up the network. To examine these modifications, do the following:

1.	Still logged into one of the NetInfo servers, open the file /etc/hostconfig. You'll find something like the following, with the host name and Internet address of your computer in place of the variables: 

HOSTNAME=hostname
INETADDR=internetaddress
ROUTER=-NO-
IPNETMASK=
IPBROADCAST=-AUTOMATIC-
NETMASTER=-YES-
YPDOMAIN=-NO-
TIME=-AUTOMATIC-

2.	Log into a computer that is not set up as a server, and open /etc/hostconfig. It should look like this: 

HOSTNAME=-AUTOMATIC-
INETADDR=-AUTOMATIC-
ROUTER=-NO-
IPNETMASK=
IPBROADCAST=-AUTOMATIC-
NETMASTER=-NO-
YPDOMAIN=-NO-
TIME=-AUTOMATIC-

The differences between the two files are in the values for HOSTNAME, INETADDR, and NETMASTER. 

If a computer has HOSTNAME and INETADDR set to -AUTOMATIC- when it starts up, it requests its host name and Internet address from a configuration server. When a configuration server itself starts up, the NetInfo database might not yet be available (since the NetInfo server is usually the configuration server, too), so its host name and Internet address are supplied from the hostconfig file. If NETMASTER is set to -YES-, the computer will act as a configuration server.

Note:  Because of the importance of hostconfig, make sure you maintain reliable backups of it.

NetInfo Daemons

Each NetInfo database needs a process to serve it; that is, a program running all the time that can get information from the database to provide to other programs that need it. For example, the login process needs to check the user name and password against information in the database. The login program contacts the database server, which returns the necessary information.

A process running all the time to provide services to other processes is called a daemon. The daemon that serves a NetInfo database is netinfod.

1.	Open a shell window on a NetInfo server and enter the following command:

ps -ax

The ps command displays process information. For more information about ps, see the UNIX manual page and Chapter 14, ªGeneral Troubleshooting.º

2.	Find lines in the output with netinfod in them, like these:

63 ?  S     2:02 /usr/etc/netinfod local
65 ?  S    16:00 /usr/etc/netinfod network

These are the two NetInfo daemons, one serving the local domain and the other serving the network domain. If your computer serves more than two domains, you'll see a process for each domain. They must be running for the network to function. 

Each daemon is started up with a tag that defines the database it serves; this tag matches the prefix of the tag.nidb directory that holds the database information. Thus the daemon netinfod local serves information from the directory /etc/netinfo/local.nidb. On a computer that's not a server, you'll find only the NetInfo daemon with the tag local. 

The following figure shows the same three computers as in the earlier figures. Below each computer is a list that includes the processes running on that computer to serve NetInfo domains, and the directories in /etc/netinfo storing the databases. 

,

Since mars and venus only serve their respective local domains, they each have a single netinfod process running and a single subdirectory in /etc/netinfo (tagged local). The host earth serves the root domain, so it has an additional netinfod process and /etc/netinfo subdirectory for the root domain (tagged network).

Troubleshooting

This section discusses actions to take if you encounter problems performing the procedures in this chapter, or if you're having network difficulties.

Automatic Host Addition Problems

When you add a new or modified host using automatic host addition, you might see one of the following messages:

·	Name recognized. New CPU board or ROM chip [y/n]?

This message indicates that the configuration server already has a host entry for the host name you entered, but that computer isn't currently running on the network. If you see this message while adding a new host, answer no (or n). You'll be prompted for another host name.

·	Host name already in use.

This message indicates that the host name you entered is the name of a computer currently running on the network. After a brief delay, you'll be prompted for a different host name.

·	Incorrect password. 

You'll get this message if you entered the network password incorrectly. You'll be returned to the beginning of the configuration process, where you'll need to enter the host name again. 

·	Server error: no available IP address. 

You'll get this message if you try to create a new host entry and the configuration server has no more addresses available to assign. The range of assignable addresses will need to be modified on the configuration server, as described earlier in the section ªEnabling Automatic Host Addition.º Once additional addresses are available, you can then add the new host.

NetInfo Directory Problems

You may see a directory in NetInfoManager that's listed as dir:# (where # is replaced by a number) rather than a name, as in the following figure.

,

What's displayed in the directory browser is actually the value of the name property for each directory. If no such property exists, NetInfoManager displays the directory number instead.

To solve this problem, follow these steps:

1.	Double-click the directory name to open the Directory window.

,

As you can see in this example, there isn't a property with the key name. It's accidentally been renamed mynewgroup. 

2.	To fix this, enter name in the text field and press Return, giving the property its correct key; name should now show in the Properties list. 

3.	Choose Save from the Directory menu to make the change permanent. Click Change in the confirmation panel if it appears. 

The value of the name property should now show in the domain window in place of dir: #.

Network Communication Problems

If you suspect that there's trouble with the underlying network mechanisms, Ethernet and TCP/IP, the programs ping and netstat can help you check to be sure these lower levels of the communication link are all right.

The program ping exchanges low-level messages between two hosts, confirming a connection. Ping other hosts on the network to see if they're receiving your messages and able to exchange information. See the UNIX manual page for ping for details.

A simple and direct test is given by ping; more detailed network information is returned by netstat. Once you can ping other hosts and you know that you have a sound network connection, you can get reports of network statistics and status with netstat. The UNIX manual page for netstat explains the details.

Once you've checked the basic level of the network with these commands and found them to be operating successfully, you can concentrate on finding problems in your network configuration.

Replacing a Corrupted NetInfo Database

If you're having major problems that you believe stem from a corrupted NetInfo database, you can restore the NetInfo and configuration server to its original, standalone state. In addition, if you're not confident about changes you've made to the local domain, you may want to restore it, too. 

	Warning:	Making a new NetInfo database is a drastic measure. Only do this as a last resort. If you've invested a lot of time creating the NetInfo database, ask an expert for help before replacing it. A better choice is to restore the hostconfig, local.nidb, and network.nidb files from backups made when the network was working properly.

Follow these steps to restore each NetInfo server to its original state: 

1.	Restore the NetInfo databases on the master NetInfo server. Be sure to do this in single-user mode (see Chapter 9, ªSystem Startup and Shutdown,º for details). On the master NetInfo server:

a.	Copy /usr/template/client/etc/hostconfig to /etc. This restores the hostconfig file to its default configuration.

b.	Remove the files in /etc/netinfo/local.nidb. This deletes the local NetInfo domain.

c.	Copy the files in /usr/template/client/etc/netinfo/local.nidb to /etc/netinfo/local.nidb. This restores the local domain to its original state.

d.	Remove /etc/netinfo/network.nidb. (If you have more than two levels in your NetInfo hierarchy, delete the directories for the other domains as well.) This removes the network NetInfo domain information.

2.	Restore the NetInfo databases on any clone NetInfo servers by logging into each clone server and following the procedures in step 1.

3.	Restore the local information on any NetInfo clients you think are damaged. On each damaged client, follow steps (a) through (c) from step 1.

4.	Reboot all the computers.

5.	Set up the NetInfo network from scratch, beginning with the procedures in Chapter 2.

Recovering from a SimpleNetworkStarter Crash

If disaster strikes while you're building the network with SimpleNetworkStarter, you might wind up with an incomplete configuration. Usually, if SimpleNetworkStarter can't complete the configuration, it will return your system to the state it was in before you began the procedure. If your system crashes before this has happened, you'll need to extract the original files ªby hand.º The following procedure replaces all the files that were modified by SimpleNetworkStarter with their originals.

1.	Turn off the computer, then turn it back on.

2.	Immediately after the ªTesting Systemº message goes away, stop the boot process by holding down the Command bar and pressing the ~ key (without pressing Shift). On keyboards with two Command keys, hold down the right Command key while pressing the ~ key. This displays the ROM monitor window, which contains information about the hardware. 

3.	Enter the following command at the ªNeXT>º prompt:

bsd -s

This command boots the computer in single-user mode. For more information, see Chapter 9.

4.	Check the file system by executing fsck following the instructions in the ªTroubleshootingº section of Chapter 9.

5.	Enter the following command to change directory to the SimpleNetworkStarter directory:

cd /NextAdmin/SimpleNetworkStarter.app

6.	Extract the original files by entering the following command:

/bin/sh rc.restore

7.	Halt the computer and turn it off with the following command:

halt -p

8.	Turn the computer back on. It's now back to its original state.